package com.example.team.controller;

import com.example.team.entity.Presenceinformation;
import com.example.team.service.IPresenceinformationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 作者:王轩
 * date: 2023/10/31
 **/
@RestController
@Api(tags = "出勤信息记录")
public class PresenceinformationController {
    @Autowired
    private IPresenceinformationService presenceinformationService;
    @RequestMapping(value = "/Presenceinformation",method = {RequestMethod.GET})
    public String Presenceinformation(){
        return "出勤信息管理系统";
    }
    //添加方法
    @ApiOperation(value = "添加出勤信息")
    @RequestMapping(value = "/insterPresenceinformation",method = {RequestMethod.GET})
    public  Integer insterPresenceinformation(Presenceinformation presenceinformation){
        return presenceinformationService.insertPresenceinformation(presenceinformation);
    }
    //删除方法
    @ApiOperation(value = "删除出勤信息信息")
    @RequestMapping(value = "/deletePresenceinformation",method = {RequestMethod.GET})
    public Integer deletePresenceinformation(Integer PresenceID){
        Presenceinformation presenceinformation=new Presenceinformation();
        presenceinformation.setPresenceID(PresenceID);
        return presenceinformationService.deletePresenceinformation(presenceinformation);
    }
    //修改方法
    @ApiOperation(value = "修改出勤信息")
    @RequestMapping(value = "/updatePresenceinformation",method = {RequestMethod.GET})
    public Integer updatePresenceinformation(Presenceinformation presenceinformation){
        return presenceinformationService.updatePresenceinformation(presenceinformation);
    }
    //查询方法
    @ApiOperation(value = "查询所有请假信息")
    @RequestMapping(value = "/getAllPresenceinformation",method = {RequestMethod.GET})
    public List<Presenceinformation> getAllPresenceinformation(Presenceinformation presenceinformation){
       return presenceinformationService.getAllPresenceinformation(presenceinformation);
    }
}
